module.exports = (sucsss, error) => {
  const mongoose = require('mongoose');
  const { Types } = require('mysql2');
  mongoose.connect('mongodb://127.0.0.1/mymongodb')
  mongoose.connection.once('open', (err, data) => {
    sucsss()

  })
  mongoose.connection.on('error', (err, data) => {
    error()
  })
  mongoose.connection.on('colse', (err, data) => {
    console.log('链接关闭');
  })
}